package com.haoxiaozhang.hxz_app.utils;

import android.content.Context;
import android.util.Log;
import android.widget.Toast;

import com.haoxiaozhang.hxz_app.viewLib.customDialog.CustomDialog;
import com.haoxiaozhang.hxz_app.viewLib.customDialog.DialogCallback;

/**
 * Created by zhy on 16/10/23.
 */
public class T {

    private static Toast toast;

    public static void showToast(
            String content) {
        toast.setText(content);
        toast.show();
    }

    public static void init(Context context) {
        toast = Toast.makeText(context,
                "",
                Toast.LENGTH_SHORT);
    }

    public static void HintDialog(Context context,final DialogCallback callback){
        CustomDialog md = new CustomDialog(context, 0) {
            @Override
            public void onSubmit() {
                callback.onSubmit();
            }

            @Override
            public void onCancel() {
                callback.onCancel();
            }
        };
        md.show();
    }

    public static void submitDialog(Context context,final DialogCallback callback){
        CustomDialog md = new CustomDialog(context, 1) {
            @Override
            public void onSubmit() {
                callback.onSubmit();
            }

            @Override
            public void onCancel() {
                callback.onCancel();
            }
        };
        md.show();
    }

}
